# -*- coding: utf-8 -*-
# author yzs
# date 2018-12-16
#
# 子矩阵问题
# Description
# 给定一个矩形区域，每一个位置上都是1或0，求该矩阵中每一个位置上都是1的最大子矩形区域中的1的个数。
# Input
# 输入的每一行是用空格隔开的0或1。
# Output
# 输出一个数值。
# Sample Input 1 
# 1 0 1 1
# 1 1 1 1
# 1 1 1 0
# Sample Output 1
# 6
# 解法：先每行扫描列求全1最长列矩阵
# 3 0 3 2
# 2 2 2 1
# 1 1 1 0
# 再扫描每行求连续和最大的值即为最大全1矩阵的数量


def get_row_statistics_matrix(matrix):
    line = len(matrix)
    column = len(matrix[0])
    row_statistics_matrix = []
    for k in range(line):
        line_list = []
        for m in range(column):
            num = 0
            for n in range(k, line):
                if matrix[n][m] == 1:
                    num += 1
                else:
                    break
            line_list.append(num)
        row_statistics_matrix.append(line_list)
    #print(row_statistics_matrix)
    return row_statistics_matrix

def count_matrix_size(left_index, right_index, key_len, i, row_statistics_matrix):
    max_count = 0
    if left_index == right_index:
        return 1
    else:
        for k in range(key_len):
            num = (key_len - k) * min(row_statistics_matrix[i][left_index:right_index + 1 - k])
            #print(key_len - k, row_statistics_matrix[i][left_index:right_index + 1 - k])
            if num > max_count:
                max_count = num
            num = (key_len - k) * min(row_statistics_matrix[i][left_index+k :right_index + 1])
            #print(key_len - k, row_statistics_matrix[i][left_index+k :right_index + 1])
            if num > max_count:
                max_count = num
    return max_count

def count_max_all_one_matrix(matrix):
    row_statistics_matrix = get_row_statistics_matrix(matrix)
    column = len(matrix)
    line = len(matrix[0])
    max_count = 0
    for i in range(column):
        key_flag = 0
        key_len = 0
        left_index = 0
        right_index = 0
        for j in range(line):
            if row_statistics_matrix[i][j] != 0:
                if key_flag == 0:
                    left_index = j
                    key_flag = 1
                key_len += 1
                right_index = j
            else:
                #0前面的有效长度计算
                num = count_matrix_size(left_index, right_index, key_len, i, row_statistics_matrix)
                if num > max_count:
                    max_count = num
                key_flag = 0
                key_len = 0
                left_index = 0
                right_index = 0
        if row_statistics_matrix[i][line-1] != 0:
            num = count_matrix_size(left_index, right_index, key_len, i, row_statistics_matrix)
            if num > max_count:
                max_count = num
    return max_count


input_matrix = []
while True:
    try:
        data = list(map(int, input().strip().split()))
        if len(data) == 0:
            break
        input_matrix.append(data)
    except EOFError:
        break

count = count_max_all_one_matrix(input_matrix)
print(count)
